package day11.gec.utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class JDBCUtil {
	//耦合度太深 
	public static final String URL = "jdbc:mysql://localhost:3306/g2148?useSSL=false&useUnicode=true&characterEncoding=utf-8";
	public static final String USER = "root";
	public static final String PASS = "123456";
	
	//提供一个获得连接的方法
	public static Connection getConnection() {
		Connection conn = null;
		try {
			conn = DriverManager.getConnection(URL, USER,PASS);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return conn;
	}
}
